Skip to content

feat(remote-config): implement server template management methods#3189

Open
congminh1254 wants to merge 4 commits into
firebase:mainfrom
congminh1254:feat/remote-config-server-template
Open

feat(remote-config): implement server template management methods#3189
congminh1254 wants to merge 4 commits into
firebase:mainfrom
congminh1254:feat/remote-config-server-template

Conversation

@congminh1254

Copy link
Copy Markdown

Description

This PR implements the missing server-side template management functions in the Remote Config service to establish parity with the Firebase Remote Config REST API v1.

Previously, the Admin Node.js SDK treated the firebase-server namespace template as a read-only resource (accessible only via getServerTemplate() / initServerTemplate()). This PR adds public APIs for programmatic fetching, validation, publishing, rollback, and version history listing for the firebase-server template.

API Changes

Adds the following public methods to the RemoteConfig class:

  • getServerConfigTemplate(): Promise<RemoteConfigTemplate>: Retrieves the current active version of the server-side Remote Config template.
  • getServerConfigTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>: Retrieves a specific version of the server-side Remote Config template.
  • validateServerConfigTemplate(template: RemoteConfigTemplate): Promise<RemoteConfigTemplate>: Validates a server-side Remote Config template against the Remote Config backend.
  • publishServerConfigTemplate(template: RemoteConfigTemplate, options?: { force: boolean }): Promise<RemoteConfigTemplate>: Publishes a server-side Remote Config template.
  • rollbackServerConfigTemplate(versionNumber: number | string): Promise<RemoteConfigTemplate>: Rolls back the published server-side Remote Config template to a specific version.
  • listServerConfigVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>: Retrieves a list of published server-side Remote Config template versions.

These additions are mirrored in the generated API signature file etc/firebase-admin.remote-config.api.md.

Testing

  • Extensively covered all new API client methods and service operations with new unit tests in:
    • test/unit/remote-config/remote-config-api-client.spec.ts
    • test/unit/remote-config/remote-config.spec.ts
  • Ran the full test suite (npm run test:unit) ensuring all 6,235 tests pass.
  • Verified that the linter (npm run lint) is completely clean.

@google-cla

google-cla Bot commented Jun 22, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds server-side Remote Config template management capabilities to the Firebase Admin SDK, introducing methods to retrieve, validate, publish, rollback, and list server-side templates, along with comprehensive unit tests. The feedback recommends refactoring sendServerPutRequest to share common logic with sendPutRequest to reduce code duplication, and adding explanatory comments in validateServerConfigTemplate and publishServerConfigTemplate to clarify ETag handling and force-publishing behavior.

Comment thread src/remote-config/remote-config-api-client-internal.ts Outdated
Comment thread src/remote-config/remote-config-api-client-internal.ts
Comment thread src/remote-config/remote-config-api-client-internal.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant